Skip to content

fix: include reuse-module initial data in @cap-js/postgres build - #1707

Open
alex-bkmr-cbs wants to merge 1 commit into
cap-js:mainfrom
alex-bkmr-cbs:fix/postgres-reuse-module-initial-data-1694
Open

fix: include reuse-module initial data in @cap-js/postgres build#1707
alex-bkmr-cbs wants to merge 1 commit into
cap-js:mainfrom
alex-bkmr-cbs:fix/postgres-reuse-module-initial-data-1694

Conversation

@alex-bkmr-cbs

Copy link
Copy Markdown

The postgres build task copied only the app-local db/data folder, dropping
initial-data CSVs shipped by reuse packages from the gen/pg artifact. This made
a fresh Postgres deployment inconsistent with cds deploy from source and with
the HANA build task.

Collect initial data across app + reuse modules via cds.deploy.resources() and
write the merged per-entity union into gen/pg/db/data. Gated by a csvFileDetection
option (default on) for parity with HANA; setting it to false restores the legacy
local-only copy.

Closes #1694

Signed-off-by: Alex alexander.buchkremer@cbs-consulting.de

The postgres build task copied only the app-local db/data folder, dropping
initial-data CSVs shipped by reuse packages from the gen/pg artifact. This made
a fresh Postgres deployment inconsistent with `cds deploy` from source and with
the HANA build task.

Collect initial data across app + reuse modules via cds.deploy.resources() and
write the merged per-entity union into gen/pg/db/data. Gated by a csvFileDetection
option (default on) for parity with HANA; setting it to false restores the legacy
local-only copy.

Closes cap-js#1694

Signed-off-by: Alex <alexander.buchkremer@cbs-consulting.de>
Comment thread postgres/cds-plugin.js

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chgeo / @swaldmann I assume that you have the same problem for the HANA build task. How do you merge the data there, given that initial data could be provided via yaml, json and not only csv. Could we somehow re-use your work in this build plugin for postgres rather than to re-invent the wheel?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you merge the data there, given that initial data could be provided via yaml, json and not only csv

Only csv files and handled by the HANA build. No support for other data formats so far.
The csv files themselves are not merged but just handed over to the HDI deployer. We have never wanted to merge data on a per-record basis, for build performance reasons, and to avoid confusion on which data gets effectively deployed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@cap-js/postgres build omits reuse-module (dependency) initial data from gen/pg

3 participants